{Camelot}
const
  dx : array[1..9] of integer = (-1, -1, -1, 0, 0, 0, 1, 1, 1);
  dy : array[1..9] of integer = (-1, 0, 1, -1, 0, 1, -1, 0, 1);
  mx : array[1..8] of integer = (-2, -1, 1, 2, 2, 1, -1, -2);
  my : array[1..8] of integer = (1, 2, 2, 1, -1, -2, -2, -1);
  max = 50;
  maxk = 100;
  oo = 1000000000;
type
  point = record
            x, y : integer;
          end;
  table = array[1..max, 1..max] of integer;
var
  a : array[1..9] of table;
  d : table;
  king : point;
  knight : array[1..maxk] of point;
  n, m : integer;
  best : longint;

procedure inp;
var
  i : integer;
begin
  read(n, m);
  with king do read(x, y);
  for i := 1 to m do
    with knight[i] do read(x, y);
end;

function inside(x, y : integer) : boolean;
begin
  inside := (1 <= x) and (x <= n) and (1 <= y) and (y <= n);
end;

procedure BFS(x0, y0 : integer; var d : table);
var
  q : array[1..2*max*max] of point;
  u, v : point;
  i, l, r : integer;
begin
  l := 1;
  r := 1;
  q[1].x := x0;
  q[1].y := y0;
  fillchar(d, sizeof(d), $30);
  d[x0, y0] := 0;

  while l <= r do
  begin
    u := q[l];
    inc(l);
    for i := 1 to 8 do
    begin
      v.x := u.x + mx[i];
      v.y := u.y + my[i];
      if inside(v.x, v.y) and (d[v.x, v.y] > d[u.x, u.y] + 1) then
      begin
        d[v.x, v.y] := d[u.x, u.y] + 1;
        inc(r);
        q[r] := v;
      end;
    end;
  end;
end;

procedure init;
var
  i : integer;
begin
  for i := 1 to 9 do
    with king do
      if inside(x+dx[i], y+dy[i]) then BFS(x+dx[i], y+dy[i], a[i]);
end;

procedure process;
var
  px, py, i, k : integer;
  sum : longint;
begin
  best := oo;
  for px := 1 to n do
    for py := 1 to n do
    begin
      BFS(px, py, d);
      sum := 0;
      for k := 1 to m do
        with knight[k] do inc(sum, d[x, y]);
      if sum < best then best := sum;

      for k := 1 to m do
        with knight[k] do
        begin
          dec(sum, d[x, y]);
          for i := 1 to 9 do
            if inside(king.x+dx[i], king.y+dy[i]) then
            begin
              inc(sum, d[king.x+dx[i], king.y+dy[i]] + a[i, x, y]);
              if i > 1 then inc(sum);
              if sum < best then best := sum;
            end;
        end;
    end;
end;

procedure out;
begin
  writeln(best);
end;

begin
  inp;
  process;
  out;
end.